package logic

import (
	"context"
	"go-exp/exp-test/nacos-test/server_demo/server_demo"

	"go-exp/exp-test/nacos-test/client_demo/internal/svc"
	"go-exp/exp-test/nacos-test/client_demo/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type Client_demoLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewClient_demoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Client_demoLogic {
	return &Client_demoLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *Client_demoLogic) Client_demo(req *types.Request) (resp *types.Response, err error) {
	// todo: add your logic here and delete this line
	l.svcCtx.ServerDemoRpc.Ping(l.ctx, &server_demo.Request{
		Ping: req.Name,
	})
	return
}
